// // 动态路由表：根据权限加载 根据generator-routers去请求路由表，确保登录后拥有token（暂时未弄）
export const dynamicRoutes = [
  {
    path: "/home",
    component: () => import('@/layout/layout.vue'),
		redirect: "/index",
		meta: {
			title: "系统管理",role: ['admin']
		},
    hidden: false,
    children: [
      {
        path: '/user',
        name: 'user',
        meta: { title: '用户列表', icon: 'AppstoreOutlined', role: ['admin'] },
          component: { template: '<div>编辑用户</div>' },
        children: [
          {
            path: 'add',
            name: 'userAdd',
            meta: { title: '新增用户', role: ['admin'] },
            component: { template: '<div>编辑用户</div>' }
          },
          {
            path: 'edit',
            name: 'userEdit',
            meta: { title: '编辑用户', role: ['admin'], hidden: true },
            component: { template: '<div>编辑用户</div>' }
          },
        ]
      },
      {
        path: '/role',
        name: 'role',
        hidden: false,
        meta: { title: '角色列表', icon: 'InboxOutlined', role: ['admin'] },
          component: { template: '<div>角色列表</div>' }
      },
      {
        path: '/permission',
        name: 'permission',
        meta: { title: '权限列表', icon: 'MailOutlined', role: ['admin'] },
          component: { template: '<div>权限列表</div>' }
      }
    ]
  },
  {
    path: '/result',
    name: 'result',
    component: () => import('@/view/exception/500.vue'),
    redirect: '/result/200',
    hidden: false,
    meta: { title: '结果页', icon: 'SettingOutlined', role: ['admin'] },
    children: [
      {
        path: '/200',
        name: '200',
        meta: { title: '成功页', role: ['admin'] },
        component: () => import('@/view/exception/500.vue')
      },
      {
        path: '/500',
        name: '500',
        meta: { title: '失败页', role: ['admin'] },
        component: () => import('@/view/exception/404.vue')
      }
    ]
  },
  {
    path: '/components',
   component: () => import('@/view/exception/500.vue'),
    name: 'components',
    meta: { title: '组件库', icon: 'QqOutlined', role: ['admin', 'root'] },
    children: [
      {
        path: '/table',
        name: 'table',
        meta: { title: '表格', role: ['admin', 'root'] },
        component: { template: '<div>表格</div>' }
      },
      {
        path: '/tree',
        name: 'tree',
        meta: { title: '树组件', role: ['admin', 'root'] },
        component: { template: '<div>树组件</div>' }
      }
    ]
  },
  {
    path: '/test',
    name: 'test',
    component: () => import('@/view/exception/500.vue'),
    redirect: '/test/index',
    meta: {
      title: '权限测试',
      icon: 'AppstoreOutlined',
      role: ['admin', 'root']
    },
    children: [
      {
        path: '/index',
        name: 'testIndex',
        meta: { title: '权限测试页', role: ['admin', 'root'] },
        component: { template: '<div>权限测试页</div>' }
      }
    ]
  },
]